package tsj.ai.alibaba.data.analysis.pojo;

import lombok.Getter;

import java.util.List;

/**
 * 关键字提取结果数据结构，用于存储每个问题变体的提取结果
 *
 * @author taoshujian
 * @version 1.0
 * @since 2025-11-13 17:31:36
 */
@Getter
public class KeywordExtractionResult {
    /**
     * Question variant
     */
    private final String question;

    /**
     * Extracted evidence list
     */
    private final List<String> evidences;

    /**
     * Extracted keyword list
     */
    private final List<String> keywords;

    /**
     * Whether extraction was successful
     */
    private final boolean successful;

    /**
     * Constructor - success case
     * @param question question variant
     * @param evidences extracted evidence list
     * @param keywords extracted keyword list
     */
    public KeywordExtractionResult(String question, List<String> evidences, List<String> keywords) {
        this.question = question;
        this.evidences = evidences;
        this.keywords = keywords;
        this.successful = true;
    }

    /**
     * Constructor - failure case
     * @param question question variant
     * @param successful whether extraction was successful
     */
    public KeywordExtractionResult(String question, boolean successful) {
        this.question = question;
        this.evidences = List.of();
        this.keywords = List.of();
        this.successful = successful;
    }

    @Override
    public String toString() {
        return "KeywordExtractionResult{" + "question='" + question + '\'' + ", evidences=" + evidences + ", keywords="
                + keywords + ", successful=" + successful + '}';
    }
}
